﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"
             xmlns:local="clr-namespace:MEFedMVVMDemo.Views" x:Class="MEFedMVVMDemo.Views.UsersScreen" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             meffed:ViewModelLocator.NonSharedViewModel="VM1">
    <UserControl.Resources>
        <DataTemplate x:Key="UserTemplate">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Name}"/>
                <TextBlock Text="{Binding Surname}" Grid.Column="1"/>
                <TextBlock Text="{Binding Age}" Grid.Column="2"/>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="SomeStates">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:2">
    					<VisualTransition.GeneratedEasingFunction>
    						<BounceEase EasingMode="EaseOut"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Welcome">
    				<Storyboard>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="textBlock">
    						<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock">
    						<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="Normal"/>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <ListBox x:Name="listBox" ItemsSource="{Binding Users}" SelectedItem="{Binding SelectedUser, Mode=TwoWay}" ItemTemplate="{StaticResource UserTemplate}" Margin="0,20,0,0" RenderTransformOrigin="0.5,0.5" >
        	<ListBox.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</ListBox.RenderTransform>
        </ListBox>
        <TextBlock x:Name="textBlock" HorizontalAlignment="Center" TextWrapping="Wrap" Text="Welcome to MEFedMVVM" VerticalAlignment="Top" Opacity="0" RenderTransformOrigin="0.5,0.5">
        	<TextBlock.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform Y="-38"/>
        		</TransformGroup>
        	</TextBlock.RenderTransform>
        </TextBlock>
		
    </Grid>
</UserControl>